package com.honey.solr.daosupport.method;

import com.honey.compilation.java.IfBlock;
import com.honey.compilation.java.JavaVisibility;
import com.honey.compilation.java.Method;
import com.honey.compilation.java.MethodDecoration;
import com.honey.compilation.java.Parameter;
import com.honey.core.builder.CharacterBuilder;
import com.honey.core.builder.CharacterBuilderFactory;
import com.honey.core.compiler.IndentSpace;
import com.honey.core.types.FullyQualifiedJavaType;
import com.honey.core.types.JDKFullyQualifiedJavaType;
import com.honey.generator.java.AbstractClassName;

public class NotMethod extends AbstractClassName {
	
	/**
	 * Lucene查询. 在查询条件之前加入"-".
	 * @param sb
	 * @return
	 */
//	private StringBuilder not(StringBuilder sb){
//		return sb.insert(0, NOT_KEYWORD); 
//	}
	
	public Method createMethod(){
		Method answer = new Method("not");
		MethodDecoration methodDecoration = answer.getDecoration();
		methodDecoration.setVisibility(JavaVisibility.PRIVATE);
		methodDecoration.setFinal(true);
		answer.setReturnType(new FullyQualifiedJavaType("StringBuilder"));
		Parameter parameter = new Parameter(new FullyQualifiedJavaType("StringBuilder"),"sb");parameter.addJavaDocLine("查询字段的名称");
		answer.addParameter(parameter);
		
		answer.addBodyLine("return sb.insert(0, NOT_KEYWORD)");
		return answer ;
	}
}
